/*
 * Powered By [Frank-Liz-Lee]
 * Copyright(C) 2012-2016 Liz Company
 * All rights reserved.
 */

package com.linln.modules.system.service;

import com.linln.common.enums.StatusEnum;
import com.linln.modules.system.domain.Role;
import com.github.pagehelper.PageInfo;
import com.linln.modules.system.domain.User;

import java.util.List;
import java.util.Set;

public interface RoleService extends GenericIService<Role,Long>{

    /**
     * 通过主键查询实体对象
     *
     * @param primaryKey
     * @return
     * @throws Exception
     */
    public Role getByPK(Long primaryKey) ;

    /**
     * 查询所有记录
     * @return
     * @throws Exception
     */
    public List<Role> list() ;

    /**
     * 根据查询条件查询所有记录
     * @return
     * @throws Exception
     */
    public List<Role> listByProperty(Role role) ;


    /**
     * 根据主键删除记录
     * @param primaryKey
     * @return
     * @throws Exception
     */
    public int deleteByPK(Long primaryKey) ;

    /**
     * 根据多个主键删除记录
     * @param primaryKeys
     * @throws Exception
     */
    public int deleteByPKeys(List<Long> primaryKeys) ;

    /**
     * 根据传入参数删除记录
     * @param role
     * @return
     * @throws Exception
     */
    public int deleteByProperty(Role role) ;

    /**
     * 保存记录
     * @param role
     * @return
     * @throws Exception
     */
    public int save(Role role) ;

    /**
     * 更新记录
     * @param role
     * @return
     * @throws Exception
     */
    public int update(Role role) ;

    /**
     * 根据条件查询记录条数
     * @param role
     * @return
     * @throws Exception
     */
    public int findByCount(Role role) ;

    /**
     * 根据查询条件查询分页记录
     * @return
     * @throws Exception
     */
    public PageInfo<Role> findByPage(Integer pageNum, Integer pageSize, Role role);

    boolean existsUserOk(Long id);


    boolean repeatByName(Role role);

    boolean updateStatus(StatusEnum statusEnum, List<Long> ids);

    List<Role> getListBySortOk();

    List<Role> getUserOkRoleList(Long id);


}
